%%figure 1 - JULIA image

load /home/mnair/projects/longp/Julia_W_new w w_climate Julia_W fday julia_model_drift fday;

X = (fday(1,:) - floor(fday(1,:)) - 5/24)*24;

Y = floor(fday(:,1)) + datenum(2000,1,1);

h=pcolor(X,Y,w);

set(h,'Edgecolor','none');

set(gca,'FontSize',16);

xlabel('LT');

ylabel('Years');

caxis([-50 50])



colorbar

title('Vertical Drift Velocity (m/s) from JULIA RADAR'); 

datetick('y','yyyy')



%clear



%%figure 2 CHAMP EEF 



load c:\manoj\projects\longp\eef_data_mod eef;

subplot(211);

set(gca,'FontSize',16);

plot(eef(:,1)+datenum(2000,1,1),eef(:,6)*1e3,'b.')

datetick

xlabel('Years');

ylabel('EEF mV/m');

subplot(212);

set(gca,'FontSize',16);

plot(eef(:,1)+datenum(2000,1,1),eef(:,4),'b.');

datetick

xlabel('Years');

ylabel('LT Hours');





%% figure 3 electric field spectra



 uiopen('C:\Manoj\projects\longp\AGUFALL08\julia_champ_spectra_new.fig',1);

grid on;

set(gca,'YMinorGrid','off');

set(gca,'XMinorGrid','off');

 ylabel(' POWER mV^2/m^2 per Hz');

 

text(1,1,'Uncorrected CHAMP data','color','c','FontSize',16);



set(gcf,'position',[1002 484 784 583]);

set(gca,'XTick',[6/60,10/60,20/60,30/60,1,2,4,6,10,30,90]);

set(gca,'XTickLabels',[' 6';'10';'20';'30';' 1';' 2';' 4';' 6';'10';'30';'90']);



a=axis;

yloc=0.003;



text(6/60,yloc,'|<-','FontSize',16);

text(8,yloc,'->|','FontSize',16);

text(40/60,yloc,'-> | <-','FontSize',16);

text(10/60,yloc,'Period in minutes','FontSize',16);

text(2,yloc,'Period in hours','FontSize',16);



%% fig3 b electric field spectra from





%% figure 4 aliasing

[x,y] = sinu_eef;

[pxx,f] = pwelch(y,rectwin(512),0,512,1/(5*60)); % 5 minutes interval

loglog(1./(3600*f(2:end-1)),pxx(2:end-1),'r');

hold on;

y_new = y(1:18:end);

[pxx,f] = pwelch(y_new,rectwin(28),0,28,1/(90*60)); % 90 minutes interval

loglog(1./(3600*f(2:end-1)),pxx(2:end-1),'b')

set(gca,'FontSize',16);

xlabel('Periods (hours)');

ylabel('Power');

title('Aliasing');

grid on;

set(gca,'YMinorGrid','off');

set(gca,'XMinorGrid','off');



a=axis;

yloc=0.00003;



text(6/60,yloc,'|<-','FontSize',16);

text(30,yloc,'->|','FontSize',16);

text(40/60,yloc,'-> | <-','FontSize',16);

text(10/60,yloc,'Period in minutes','FontSize',16);

text(2,yloc,'Period in hours','FontSize',16);

%uiopen('home/mnair/projects/longp/aliasing.fig',1)





%% figure 5 coherence

 uiopen('C:\Manoj\projects\longp\AGUFALL08\JULIA_CHAMP_ACE_COH.fig',1);

 grid on;

set(gca,'YMinorGrid','off');

set(gca,'XMinorGrid','off');







%% figure 6 transfer function

uiopen('/home/mnair/projects/longp/tf_db_magnitue_julia_champ.fig',1);



Xmag = abs(Txy);          % Spectral magnitude

Xdb = 20*log10(Xmag);   % Spectral magnitude in dB





semilogx((1./(3600*f(2:end-1))),Xdb(2:end-1),cl_c,'LineWidth',2);

axis([0.1 10 -45 -15 ]);



axis([0.1 10, -50 ,100]);



a=axis;

yloc=a(3)-((a(4)-a(3))*0.08);





set(gcf,'position',[1002 484 784 583]);

set(gca,'XTick',[6/60,10/60,20/60,30/60,1,2,4,6,10,30]);

set(gca,'XTickLabels',[' 6';'10';'20';'30';' 1';' 2';' 4';' 6';'10';'30']);

text(6/60,yloc,'|<-','FontSize',16);

text(8,yloc,'->|','FontSize',16);

text(40/60,yloc,'-> | <-','FontSize',16);

text(10/60,yloc,'Period in minutes','FontSize',16);

text(2,yloc,'Period in hours','FontSize',16);



%





%% figure 7 fit of the filter

uiopen('C:\Manoj\projects\longp\Tf_filter_response.fig',1)

axis([0.1000  40.0000    0.001    0.1000]);

 grid on;

set(gca,'YMinorGrid','off');

set(gca,'XMinorGrid','off');

